/* static/user/css/modules/cart.css */
/* 悬浮按钮 */
.cart-floating-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    background: #3498db;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.2s;
}

.cart-floating-btn:hover {
    transform: scale(1.1);
}

.icon-cart {
    color: white;
    font-size: 24px;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 购物车抽屉 */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    height: 100%;
    background: white;
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer--active {
    right: 0;
}

.cart-drawer__header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-drawer__close-btn {
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

.cart-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 购物车项 */
.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.cart-item__image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item__content {
    flex: 1;
}

.cart-item__title {
    font-size: 16px;
    margin-bottom: 4px;
}

.cart-item__price {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 8px;
}

.cart-item__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

/* 在cart.css中添加 */
.delete-btn {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 12px;
}

.delete-btn:hover {
    background: #c0392b;
}

/* 数量输入框禁用状态 */
.quantity-input:disabled {
    background: #f8f9fa;
    border-color: #eee;
}

/* 补充的CSS样式 */
.cart-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.icon-cart {
    font-size: 24px;
    margin-bottom: 2px;
}

.cart-label {
    font-size: 12px;
    color: white;
    white-space: nowrap;
}



/*!* 调整徽章位置 *!*/
/*.cart-badge {*/
/*    top: 8px;*/
/*    right: 8px;*/
/*}*/

/* 移动端适配 */
@media (max-width: 768px) {
    .cart-label {
        display: none;
    }
    .cart-floating-btn {
        width: 56px;
        height: 56px;
    }
}